#!/usr/bin/perl
use strict;
use warnings;
open my $outputfile, ">", "release.txt" or die "Cannot open release file $!";
sub get_repos {
  my ($folder, $version) = @_;
  open my $fh, "<", "batfile" or die "Cannot open file $!";
  my @array = <$fh>;
  foreach (@array) {
    $_ =~ s/_NC//g;
    $_ =~ s/%\///g;
    my $cmd;
    if ($_ =~ /%SVN_SERVER(.*?)\/%CHECKPOINT/) {
      #print "$1\n";
    svn_checkout($1);
    }
  }
 }
get_repos($ARGV[0], $ARGV[1]);

sub svn_checkout {
  my $directories = shift;
  chdir $directories or die "Cannot CD into the directories $!";
  my @cmd = `cat svnup`;
  chdir("..");
  foreach my $item (@cmd) {
    if ($item =~ /^Last Changed Rev:/) {
      return $item;
    }
  }
}

